import 'package:flutter_learn_vi/src/bean/bean_user.dart';

/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2020/7/23.
///
/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2020/9/25.
///
/// gongzhonghao biglead
/// https://study.163.com/instructor/1021406098.htm
/// https://blog.csdn.net/zl18603543572
/// https://www.toutiao.com/c/user/token/MS4wLjABAAAAYMrKikomuQJ4d-cPaeBqtAK2cQY697Pv9xIyyDhtwIM/

class LoginBean {
  int mineId;
  int expire;
  int userId;
  String token;
  UserBean user;

  LoginBean.fromJson(Map<String, dynamic> paraMap) {
    Map<String, dynamic> map = paraMap["data"];
    this.userId = map["userId"];
    this.expire = map["expire"];
    this.mineId = map["mineId"];
    this.token = map["token"];

    this.user = UserBean.fromJson(map["user"]);
    this.user.token = this.token;
  }
  LoginBean.fromCacheJson(Map<String, dynamic> map) {
    this.userId = map["userId"];
    this.expire = map["expire"];
    this.mineId = map["mineId"];
    this.token = map["token"];
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> map = new Map<String, dynamic>();
    map["userId"] = this.userId;
    map["expire"] = this.expire;
    map["mineId"] = this.mineId;
    map["token"] = this.token;
    return map;
  }
}
